<!DOCTYPE html>

<html lang="en">
  <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>调试应用程序（Debugging Applications） &mdash; Phalcon 2.0.0 文档</title>
    <meta name="keywords" content="php, phalcon, phalcon php, php framework, faster php framework"><link rel="stylesheet" type="text/css" href="../_static/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="http://static.phalconphp.com/css/phalcon.min.css" />
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400' rel='stylesheet' type='text/css'>
    <link href="http://fonts.googleapis.com/css?family=Merriweather:400,700" rel="stylesheet" type="text/css" />
    <!--
    EUROPE <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=latin-ext' rel='stylesheet' type='text/css'>
    GREEK <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=greek-ext' rel='stylesheet' type='text/css'>
    RUSSIA <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=cyrillic-ext,latin' rel='stylesheet' type='text/css'>
    -->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/docs.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.0.0',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>

    <script src="../_static/jquery.min.js"></script>
    <script type="text/javascript" src="../_static/docs.js"></script>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="top" title="Phalcon 2.0.0 文档" href="../index.html" />
    <link rel="next" title="Phalcon 开发工具（Phalcon Developer Tools）" href="tools.html" />
    <link rel="prev" title="数据库迁移（Database Migrations）" href="migrations.html" /> 
  </head>
  <body>

<header class="page-header">
    <nav class="navbar" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-menu-container">
                    <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
                </button>
                <a class="navbar-brand phalcon-logo" href="/"><span itemprop="name" class="sr-only">Phalcon PHP</span></a>
            </div>

            <div class="collapse navbar-collapse navbar-right" id="main-menu-container">
                <ul class="nav navbar-nav main-menu">
                  <li class="first"><a href="http://phalconphp.com/en/download" class="header-nav-link">Download</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/index.html" class="header-nav-link" target="_blank">Documentation</a></li>
                  <li><a href="http://forum.phalconphp.com/" class="header-nav-link" target="_blank">Forum</a></li>
                  <li><a href="http://blog.phalconphp.com/" class="header-nav-link" target="_blank">Blog</a></li>
                  <li><a href="http://phalconphp.com/en/about">About</a></li>
                </ul>
            </div>
        </div>
    </nav>
  </header>

<div class="heading">
    <div class="container">
        <div class="row">
            <h2>Documentation</h2>
        </div>
    </div>
</div>
    <!--<div class="header-line">
      <div class="size-wrap">
        <div class="header-line-title title-white">Documentation</div>
      </div>
    </div>-->
    <div class="related">
      <ul>
        <li class="right" >
          <a href="../genindex.html" title="总目录"
             accesskey="I">索引</a></li>
        <li class="right" >
          <a href="tools.html" title="Phalcon 开发工具（Phalcon Developer Tools）"
             accesskey="N">下一页</a> |</li>
        <li class="right" >
          <a href="migrations.html" title="数据库迁移（Database Migrations）"
             accesskey="P">上一页</a> |</li>
        <li><a href="http://phalconphp.com">Home</a> &raquo;</li>
        <li><a href="../index.html">Phalcon 2.0.0 文档</a> &raquo;</li> 
      </ul>
    </div>  

      <table width="100%" align="center" cellpadding="0" cellspacing="0">
        <tr>
      <td class="primary-box" width="25%" valign="top">
            <div>
            <div id="searchbox" style="">
                <!--<form class="search" action="http://readthedocs.org/search/project/" method="get">
                  <input type="search" name="q" size="25" placeholder="Search">
                  <input type="submit" value="Go">
                  <input type="hidden" name="selected_facets" value="project:">
                </form>-->
                <div style="width:200px;padding:10px">
                  <gcse:searchbox-only></gcse:searchbox-only>
                </div>
            </div>
            </div>
            <div style="padding:5px;padding-left:10px">
              <div id="carbonads-container">
                <div class="carbonad"><div id="azcarbon"></div>
                <script type="text/javascript">var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = "http://engine.carbonads.com/z/56496/azcarbon_2_1_0_VERT"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script>
                </div></div>
            </div>
            <h3><a href="../index.html">內容目录</a></h3>
            <ul>
<li><a class="reference internal" href="#">调试应用程序（Debugging Applications）</a><ul>
<li><a class="reference internal" href="#catching-exceptions">捕获异常（Catching Exceptions）</a></li>
<li><a class="reference internal" href="#debug-component">调试组件（Debug component）</a></li>
<li><a class="reference internal" href="#reflection-and-introspection">反射与内省（Reflection and Introspection）</a></li>
<li><a class="reference internal" href="#xdebug-using-xdebug">使用 XDebug（Using XDebug）</a></li>
</ul>
</li>
</ul>

            <h4>上一个主题</h4>
            <p class="topless"><a href="migrations.html" title="上一章">&lt; 数据库迁移（Database Migrations）</a></p>
            <h4>下一个主题</h4>
            <p class="topless"><a href="tools.html" title="下一章">Phalcon 开发工具（Phalcon Developer Tools） &gt;</a></p>
            <h3>本页</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/reference/debug.txt" rel="nofollow">显示源代码</a></li>
            </ul>
        </td>
          <td class="second-box" valign="top">
            <div class="document">
                <div class="documentwrapper">
                  <div class="bodywrapper">
                    <div class="body" >
                      
  <div class="section" id="debugging-applications">
<h1>调试应用程序（Debugging Applications）<a class="headerlink" href="#debugging-applications" title="永久链接至标题">¶</a></h1>
<div class="figure align-center">
<img alt="../_images/xdebug-1.jpg" src="../_images/xdebug-1.jpg" />
</div>
<p>Phalcon中提供了提供了几种调试级别即通知，错误和异常。 异常类 <a class="reference external" href="http://www.php.net/manual/en/language.exceptions.php">Exception class</a> 提供了错误发生时的一些常用的调试信息如文件，行，消息，错误代码，跟踪信息等。
Phalcon主要使用这个异常类来包装这些功能，以方便开发者或用户使用。</p>
<p>尽管Phalcon是使用C语言书写的，但其依然如其它的PHP框架般提供了一些必须的调试工具，PHP本身提供的调试工具亦然可以正常使用。</p>
<div class="section" id="catching-exceptions">
<h2>捕获异常（Catching Exceptions）<a class="headerlink" href="#catching-exceptions" title="永久链接至标题">¶</a></h2>
<p>纵观Phalcon的文档及其提供的例子程序， 有一个最直接的捕获异常的方法即是使用try/catch块：</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">try</span> <span class="p">{</span>

    <span class="c1">//... some phalcon/php code</span>

<span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">\Exception</span> <span class="nv">$e</span><span class="p">)</span> <span class="p">{</span>

<span class="p">}</span>
</pre></div>
</div>
<p>try/catch块内发生的异常会被捕获然后放入 $e 变量。 开发者可以使用 <a class="reference internal" href="../api/Phalcon_Exception.html"><em>Phalcon\Exception</em></a> （扩展自 <a class="reference external" href="http://www.php.net/manual/en/language.exceptions.php">Exception class</a> ）来确定异常信息是来自Phalcon还是PHP本身。
PHP产生的所有异常都是基于 <a class="reference external" href="http://www.php.net/manual/en/language.exceptions.php">Exception class</a> ， 且至少含有如下元素：</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">class</span> <span class="nc">Exception</span>
<span class="p">{</span>

    <span class="cm">/* Properties */</span>
    <span class="k">protected</span> <span class="nx">string</span> <span class="nv">$message</span><span class="p">;</span>
    <span class="k">protected</span> <span class="nx">int</span> <span class="nv">$code</span><span class="p">;</span>
    <span class="k">protected</span> <span class="nx">string</span> <span class="nv">$file</span><span class="p">;</span>
    <span class="k">protected</span> <span class="nx">int</span> <span class="nv">$line</span><span class="p">;</span>

    <span class="cm">/* Methods */</span>
    <span class="k">public</span> <span class="nx">__construct</span> <span class="p">([</span> <span class="nx">string</span> <span class="nv">$message</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span> <span class="p">[,</span> <span class="nx">int</span> <span class="nv">$code</span> <span class="o">=</span> <span class="mi">0</span> <span class="p">[,</span> <span class="nx">Exception</span> <span class="nv">$previous</span> <span class="o">=</span> <span class="k">NULL</span> <span class="p">]]])</span>
    <span class="k">final</span> <span class="k">public</span> <span class="nx">string</span> <span class="nx">getMessage</span> <span class="p">(</span> <span class="nx">void</span> <span class="p">)</span>
    <span class="k">final</span> <span class="k">public</span> <span class="nx">Exception</span> <span class="nx">getPrevious</span> <span class="p">(</span> <span class="nx">void</span> <span class="p">)</span>
    <span class="k">final</span> <span class="k">public</span> <span class="nx">mixed</span> <span class="nx">getCode</span> <span class="p">(</span> <span class="nx">void</span> <span class="p">)</span>
    <span class="k">final</span> <span class="k">public</span> <span class="nx">string</span> <span class="nx">getFile</span> <span class="p">(</span> <span class="nx">void</span> <span class="p">)</span>
    <span class="k">final</span> <span class="k">public</span> <span class="nx">int</span> <span class="nx">getLine</span> <span class="p">(</span> <span class="nx">void</span> <span class="p">)</span>
    <span class="k">final</span> <span class="k">public</span> <span class="k">array</span> <span class="nx">getTrace</span> <span class="p">(</span> <span class="nx">void</span> <span class="p">)</span>
    <span class="k">final</span> <span class="k">public</span> <span class="nx">string</span> <span class="nx">getTraceAsString</span> <span class="p">(</span> <span class="nx">void</span> <span class="p">)</span>
    <span class="k">public</span> <span class="nx">string</span> <span class="nx">__toString</span> <span class="p">(</span> <span class="nx">void</span> <span class="p">)</span>
    <span class="k">final</span> <span class="k">private</span> <span class="nx">void</span> <span class="nx">__clone</span> <span class="p">(</span> <span class="nx">void</span> <span class="p">)</span>

<span class="p">}</span>
</pre></div>
</div>
<p>如从 <a class="reference external" href="http://www.php.net/manual/en/language.exceptions.php">Exception class</a> 中取得异常信息一样， 我也可以从 <a class="reference internal" href="../api/Phalcon_Exception.html"><em>Phalcon\Exception</em></a> 中取异常信息。</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">try</span> <span class="p">{</span>

    <span class="c1">//... app code ...</span>

<span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">\Exception</span> <span class="nv">$e</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">echo</span> <span class="nb">get_class</span><span class="p">(</span><span class="nv">$e</span><span class="p">),</span> <span class="s2">&quot;: &quot;</span><span class="p">,</span> <span class="nv">$e</span><span class="o">-&gt;</span><span class="na">getMessage</span><span class="p">(),</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
    <span class="k">echo</span> <span class="s2">&quot; File=&quot;</span><span class="p">,</span> <span class="nv">$e</span><span class="o">-&gt;</span><span class="na">getFile</span><span class="p">(),</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
    <span class="k">echo</span> <span class="s2">&quot; Line=&quot;</span><span class="p">,</span> <span class="nv">$e</span><span class="o">-&gt;</span><span class="na">getLine</span><span class="p">(),</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
    <span class="k">echo</span> <span class="nv">$e</span><span class="o">-&gt;</span><span class="na">getTraceAsString</span><span class="p">();</span>
<span class="p">}</span>
</pre></div>
</div>
<p>因此， 开发者可以非常容易找出在哪个文件中哪一行产生的异常信息，也可以看到异常信息涉及到的模块：</p>
<div class="highlight-html"><div class="highlight"><pre>PDOException: SQLSTATE[28000] [1045] Access denied for user &#39;root&#39;@&#39;localhost&#39;
    (using password: NO)
 File=/Applications/MAMP/htdocs/invo/public/index.php
 Line=74
#0 [internal function]: PDO-&gt;__construct(&#39;mysql:host=loca...&#39;, &#39;root&#39;, &#39;&#39;, Array)
#1 [internal function]: Phalcon\Db\Adapter\Pdo-&gt;connect(Array)
#2 /Applications/MAMP/htdocs/invo/public/index.php(74):
    Phalcon\Db\Adapter\Pdo-&gt;__construct(Array)
#3 [internal function]: {closure}()
#4 [internal function]: call_user_func_array(Object(Closure), Array)
#5 [internal function]: Phalcon\DI-&gt;_factory(Object(Closure), Array)
#6 [internal function]: Phalcon\DI-&gt;get(&#39;db&#39;, Array)
#7 [internal function]: Phalcon\DI-&gt;getShared(&#39;db&#39;)
#8 [internal function]: Phalcon\Mvc\Model-&gt;getConnection()
#9 [internal function]: Phalcon\Mvc\Model::_getOrCreateResultset(&#39;Users&#39;, Array, true)
#10 /Applications/MAMP/htdocs/invo/app/controllers/SessionController.php(83):
    Phalcon\Mvc\Model::findFirst(&#39;email=&#39;demo@pha...&#39;)
#11 [internal function]: SessionController-&gt;startAction()
#12 [internal function]: call_user_func_array(Array, Array)
#13 [internal function]: Phalcon\Mvc\Dispatcher-&gt;dispatch()
#14 /Applications/MAMP/htdocs/invo/public/index.php(114): Phalcon\Mvc\Application-&gt;handle()
#15 {main}
</pre></div>
</div>
<p>从上面我们可以看到异常信息中有Phalcon的类及方法，甚至调用时的参数也显示了出来。 如果需要可以使用 <a class="reference external" href="http://www.php.net/manual/en/exception.gettrace.php">Exception::getTrace</a> 获取更多的信息。</p>
</div>
<div class="section" id="debug-component">
<h2>调试组件（Debug component）<a class="headerlink" href="#debug-component" title="永久链接至标题">¶</a></h2>
<p>Phalcon提供的调试组件可以使开发者更容易的定位代码中的错误。</p>
<p>下面的视频中展示了如何工作的：</p>
<div align="center">
    <iframe src="http://player.vimeo.com/video/68893840" width="500" height="313" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div><p>要打开调试功能只需要如下做：</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="nv">$debug</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">\Phalcon\Debug</span><span class="p">();</span>
<span class="nv">$debug</span><span class="o">-&gt;</span><span class="na">listen</span><span class="p">();</span>
</pre></div>
</div>
<p>注意一定要去掉Try/Catch块才可以， 否则异常信息不会正确的输出（事实上很多时候Phalco显示异常信息是非常耗时的）。</p>
</div>
<div class="section" id="reflection-and-introspection">
<h2>反射与内省（Reflection and Introspection）<a class="headerlink" href="#reflection-and-introspection" title="永久链接至标题">¶</a></h2>
<p>Phalcon的类的实例通常比一般的类实例更复杂。 这里我们可以使用 &#8216;Reflection API&#8217;_ (反射机制) 或 直接打印其内部状态来观其究竟：</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="nv">$router</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Phalcon\Mvc\Router</span><span class="p">();</span>
<span class="nb">print_r</span><span class="p">(</span><span class="nv">$router</span><span class="p">);</span>
</pre></div>
</div>
<p>开发者可以非常容易的观察到对象内部的状态。 上面的代码输出如下：</p>
<div class="highlight-html"><div class="highlight"><pre>Phalcon\Mvc\Router Object
(
    [_dependencyInjector:protected] =&gt;
    [_module:protected] =&gt;
    [_controller:protected] =&gt;
    [_action:protected] =&gt;
    [_params:protected] =&gt; Array
        (
        )
    [_routes:protected] =&gt; Array
        (
            [0] =&gt; Phalcon\Mvc\Router\Route Object
                (
                    [_pattern:protected] =&gt; #^/([a-zA-Z0-9\_]+)[/]{0,1}$#
                    [_compiledPattern:protected] =&gt; #^/([a-zA-Z0-9\_]+)[/]{0,1}$#
                    [_paths:protected] =&gt; Array
                        (
                            [controller] =&gt; 1
                        )

                    [_methods:protected] =&gt;
                    [_id:protected] =&gt; 0
                    [_name:protected] =&gt;
                )

            [1] =&gt; Phalcon\Mvc\Router\Route Object
                (
                    [_pattern:protected] =&gt; #^/([a-zA-Z0-9\_]+)/([a-zA-Z0-9\_]+)(/.*)*$#
                    [_compiledPattern:protected] =&gt; #^/([a-zA-Z0-9\_]+)/([a-zA-Z0-9\_]+)(/.*)*$#
                    [_paths:protected] =&gt; Array
                        (
                            [controller] =&gt; 1
                            [action] =&gt; 2
                            [params] =&gt; 3
                        )
                    [_methods:protected] =&gt;
                    [_id:protected] =&gt; 1
                    [_name:protected] =&gt;
                )
        )
    [_matchedRoute:protected] =&gt;
    [_matches:protected] =&gt;
    [_wasMatched:protected] =&gt;
    [_defaultModule:protected] =&gt;
    [_defaultController:protected] =&gt;
    [_defaultAction:protected] =&gt;
    [_defaultParams:protected] =&gt; Array
        (
        )
)
</pre></div>
</div>
</div>
<div class="section" id="xdebug-using-xdebug">
<h2>使用 XDebug（Using XDebug）<a class="headerlink" href="#xdebug-using-xdebug" title="永久链接至标题">¶</a></h2>
<p><a class="reference external" href="http://xdebug.org">XDebug</a> 是一个非常好（神奇）的调试工具，其和PHP内部调试工具一起为我们提调试工具（可以和PHP内置的调试工具互补）。 <a class="reference external" href="http://xdebug.org">XDebug</a> 也是一个PHP扩展， 所以二者可以一起使用，而且不需要额外的配置。</p>
<p>下面的视频中展示了Phalcon中使用XDebug的情况：</p>
<div align="center">
    <iframe src="http://player.vimeo.com/video/69867342" width="500" height="313" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div><p>一旦安装了xdebug, 开发者便可以使用其API来取得更多的异常信息和其它信息：</p>
<p>我们强烈推荐至少使用XDebug 2.2.3 以提供与Phalcon最佳的兼容性。下面的例子中调用了 <a class="reference external" href="http://xdebug.org/docs/stack_trace">xdebug_print_function_stack</a> 方法，
并返回了该方法产生的代码跟踪结果.</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">class</span> <span class="nc">SignupController</span> <span class="k">extends</span> <span class="nx">\Phalcon\Mvc\Controller</span>
<span class="p">{</span>

    <span class="k">public</span> <span class="k">function</span> <span class="nf">indexAction</span><span class="p">()</span>
    <span class="p">{</span>

    <span class="p">}</span>

    <span class="k">public</span> <span class="k">function</span> <span class="nf">registerAction</span><span class="p">()</span>
    <span class="p">{</span>

        <span class="c1">// Request variables from html form</span>
        <span class="nv">$name</span>  <span class="o">=</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">request</span><span class="o">-&gt;</span><span class="na">getPost</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">,</span> <span class="s2">&quot;string&quot;</span><span class="p">);</span>
        <span class="nv">$email</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">request</span><span class="o">-&gt;</span><span class="na">getPost</span><span class="p">(</span><span class="s2">&quot;email&quot;</span><span class="p">,</span> <span class="s2">&quot;email&quot;</span><span class="p">);</span>

        <span class="c1">// Stop execution and show a backtrace</span>
        <span class="k">return</span> <span class="nx">xdebug_print_function_stack</span><span class="p">(</span><span class="s2">&quot;stop here!&quot;</span><span class="p">);</span>

        <span class="nv">$user</span>        <span class="o">=</span> <span class="k">new</span> <span class="nx">Users</span><span class="p">();</span>
        <span class="nv">$user</span><span class="o">-&gt;</span><span class="na">name</span>  <span class="o">=</span> <span class="nv">$name</span><span class="p">;</span>
        <span class="nv">$user</span><span class="o">-&gt;</span><span class="na">email</span> <span class="o">=</span> <span class="nv">$email</span><span class="p">;</span>

        <span class="c1">// Store and check for errors</span>
        <span class="nv">$user</span><span class="o">-&gt;</span><span class="na">save</span><span class="p">();</span>
    <span class="p">}</span>

<span class="p">}</span>
</pre></div>
</div>
<p>这个例子中， XDebug显示出了局部变量和代码的跟踪信息：</p>
<div class="highlight-html"><div class="highlight"><pre>Xdebug: stop here! in /Applications/MAMP/htdocs/tutorial/app/controllers/SignupController.php
    on line 19

Call Stack:
    0.0383     654600   1. {main}() /Applications/MAMP/htdocs/tutorial/public/index.php:0
    0.0392     663864   2. Phalcon\Mvc\Application-&gt;handle()
        /Applications/MAMP/htdocs/tutorial/public/index.php:37
    0.0418     738848   3. SignupController-&gt;registerAction()
        /Applications/MAMP/htdocs/tutorial/public/index.php:0
    0.0419     740144   4. xdebug_print_function_stack()
        /Applications/MAMP/htdocs/tutorial/app/controllers/SignupController.php:19
</pre></div>
</div>
<p>使用xdebug我们可以使用若干种方法来取得关phalcon应用的调试信息。更多信可以参看这里的 <a class="reference external" href="http://xdebug.org/docs">XDebug documentation</a> （ XDebug 文档）。</p>
</div>
</div>


                    </div>
                  </div>
                </div>
            </div>
          </td>
        </tr>
      </table>
    <div class="related">
      <ul>
        <li class="right" >
          <a href="../genindex.html" title="总目录"
             >索引</a></li>
        <li class="right" >
          <a href="tools.html" title="Phalcon 开发工具（Phalcon Developer Tools）"
             >下一页</a> |</li>
        <li class="right" >
          <a href="migrations.html" title="数据库迁移（Database Migrations）"
             >上一页</a> |</li> 
      </ul>
    </div>

      <div class="prefooter">
  <div class="container">
      <div class="row">
          <div class="col-sm-3 text-right">
              <span>Follow along:</span>
          </div>
          <div class="col-sm-6 text-center">
              <a href="https://twitter.com/phalconphp" alt="Twitter" class="btn-social btn-social-twitter"><i class="icon-twitter"></i></a>
              <a href="https://www.facebook.com/pages/Phalcon-Framework/134230726685897" alt="Facebook" class="btn-social btn-social-facebook"><i class="icon-facebook"></i></a>
              <a href="https://plus.google.com/102376109340560896457" alt="Google+" class="btn-social btn-social-googleplus"><i class="icon-googleplus"></i></a>
              <a href="https://github.com/phalcon/cphalcon" alt="Github" class="btn-social btn-social-github"><i class="icon-github"></i></a>
          </div>
          <div class="col-sm-3">
          </div>
      </div>
  </div>

</div>
<footer class="footer">
  <div class="container">
      <div class="row">
          <div class="col-xs-4 col-sm-3">
              <h4>Download</h4>
              <ul>
                  <li><a href="http://phalconphp.com/download">Installing Phalcon</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/index.html" class="header-nav-link" target="_blank">Documentation</a></li>
                  <li><a href="http://api.phalconphp.com">API</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/reference/tutorial.html">Tutorial</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/reference/tutorial.html#sample-applications">Sample Applications</a></li>
              </ul>
          </div>
          <div class="col-xs-4 col-sm-3">
              <h4>Community</h4>
              <ul>
                  <li><a href="http://forum.phalconphp.com/" class="header-nav-link" target="_blank">Forum</a></li>
                  <li><a href="https://github.com/phalcon/cphalcon">GitHub</a></li>
                  <li><a href="https://github.com/phalcon/cphalcon/issues">Issue Tracker</a></li>
                  <li><a href="http://stackoverflow.com/questions/tagged/phalcon">Stack Overflow</a></li>
                  <li><a href="http://phalconphp.com/en/testimonials">Testimonials</a></li>
                  <li><a href="http://builtwith.phalconphp.com/">Built with Phalcon</a></li>
                  <li><a href="http://store.phalconphp.com/">Store</a></li>
              </ul>
          </div>
          <div class="col-xs-4 col-sm-2">
              <h4>About</h4>
              <ul>
                  <li><a class="link-black" href="http://blog.phalconphp.com/">Blog</a></li>
                  <li><a href="http://phalconphp.com/en/about">About</a></li>
                  <li><a href="http://phalconphp.com/en/team">Team</a></li>
                  <li><a href="http://phalconphp.com/en/roadmap">Roadmap</a></li>
                  <li><a href="http://phalconphp.com/en/donate">Donate</a></li>
                  <li><a href="http://phalconphp.com/en/consulting">Consulting</a></li>
                  <li><a href="http://phalconphp.com/en/hosting">Hosting</a></li>
              </ul>
          </div>
          <div id="license-spaccer" class="visible-xs"></div>
          <div id="license-wrapper" class="col-xs-12 col-sm-4">
              <p class="license">

                  Found a typo or an error? Want to improve this document? The documentation sources are available on <a href="http://github.com/phalcon/docs">Github</a><br>
                  Need support or have questions? Check our <a href="http://forum.phalconphp.com">Forum</a><br>
                  <br>

                  Phalcon Framework is released under the <a href="https://github.com/phalcon/cphalcon/blob/master/docs/LICENSE.md">new BSD license</a>.<br>
                  Except where otherwise noted, content on this site is licensed under the
                    <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 License.</a>

                <div class="design">
                  <span>Designed by:</span>

                  <a href="http://www.fog-city.net/" class="fogcity" target="_blank" title="Fog City Software"><span>Fog City Software</span></a>
              </div>
          </div>
      </div>
  </div>
</footer>

    </div>
    <script type="text/javascript">
    $(window).on("load", function(){
      var cx = '009733439235723428699:lh9ltjgvdz8';
      var gcse = document.createElement('script');
      gcse.type = 'text/javascript';
      gcse.async = true;
      gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx;
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(gcse, s);
    });
    </script>

  </body>
</html>